double width,
double height)
{
- GtkSnapshot snapshot;
+ GtkSnapshot *snapshot;
GskRenderNode *node;
cairo_region_t *clip;
cairo_save (cr);
clip = cairo_region_create_rectangle (&(cairo_rectangle_int_t) { 0, 0, width, height });
- gtk_snapshot_init (&snapshot, NULL, FALSE, clip, "Fallback<%s>", G_OBJECT_TYPE_NAME (image));
- gtk_css_image_snapshot (image, &snapshot, width, height);
- node = gtk_snapshot_finish (&snapshot);
+ snapshot = gtk_snapshot_new (NULL, FALSE, clip, "Fallback<%s>", G_OBJECT_TYPE_NAME (image));
+ gtk_css_image_snapshot (image, snapshot, width, height);
+ node = gtk_snapshot_free_to_node (snapshot);
if (node != NULL)
{
GtkTreePath *path)
{
GtkWidget *widget;
- GtkSnapshot snapshot;
+ GtkSnapshot *snapshot;
GskRenderNode *node;
cairo_t *cr;
cairo_surface_t *surface;
rect.width,
rect.height);
- gtk_snapshot_init (&snapshot, NULL, FALSE, NULL, "IconView DragIcon");
- gtk_icon_view_snapshot_item (icon_view, &snapshot, item,
- icon_view->priv->item_padding,
- icon_view->priv->item_padding,
- FALSE);
- node = gtk_snapshot_finish (&snapshot);
+ snapshot = gtk_snapshot_new (NULL, FALSE, NULL, "IconView DragIcon");
+ gtk_icon_view_snapshot_item (icon_view, snapshot, item,
+ icon_view->priv->item_padding,
+ icon_view->priv->item_padding,
+ FALSE);
+ node = gtk_snapshot_free_to_node (snapshot);
cr = cairo_create (surface);
- gsk_render_node_draw (node, cr);
+ gsk_render_node_draw (node, cr);
cairo_destroy (cr);
return surface;
{
GtkMagnifier *magnifier = GTK_MAGNIFIER (widget);
GtkMagnifierPrivate *priv = _gtk_magnifier_get_instance_private (magnifier);
- GtkSnapshot inspected_snapshot;
+ GtkSnapshot *inspected_snapshot;
GskRenderNode *inspected_node;
graphene_matrix_t transform;
g_signal_handler_block (priv->inspected, priv->draw_handler);
- gtk_snapshot_init (&inspected_snapshot,
- gtk_snapshot_get_renderer (snapshot),
- snapshot->record_names,
- NULL,
- "MagnifierSnapshot");
+ inspected_snapshot = gtk_snapshot_new (gtk_snapshot_get_renderer (snapshot),
+ snapshot->record_names,
+ NULL,
+ "MagnifierSnapshot");
- gtk_widget_snapshot (priv->inspected, &inspected_snapshot);
- inspected_node = gtk_snapshot_finish (&inspected_snapshot);
+ gtk_widget_snapshot (priv->inspected, inspected_snapshot);
+ inspected_node = gtk_snapshot_free_to_node (inspected_snapshot);
if (inspected_node != NULL)
{
if (main_widget_node == NULL)
{
- GtkSnapshot child_snapshot;
-
- gtk_snapshot_init (&child_snapshot,
- gtk_snapshot_get_renderer (snapshot),
- snapshot->record_names,
- NULL,
- "OverlayCaptureMainChild");
- gtk_snapshot_offset (&child_snapshot, main_alloc.x, main_alloc.y);
- gtk_widget_snapshot (main_widget, &child_snapshot);
- gtk_snapshot_offset (&child_snapshot, -main_alloc.x, -main_alloc.y);
- main_widget_node = gtk_snapshot_finish (&child_snapshot);
+ GtkSnapshot *child_snapshot;
+
+ child_snapshot = gtk_snapshot_new (gtk_snapshot_get_renderer (snapshot),
+ snapshot->record_names,
+ NULL,
+ "OverlayCaptureMainChild");
+ gtk_snapshot_offset (child_snapshot, main_alloc.x, main_alloc.y);
+ gtk_widget_snapshot (main_widget, child_snapshot);
+ gtk_snapshot_offset (child_snapshot, -main_alloc.x, -main_alloc.y);
+ main_widget_node = gtk_snapshot_free_to_node (child_snapshot);
graphene_matrix_init_translate (&translate, &GRAPHENE_POINT3D_INIT (main_alloc.x,main_alloc.y, 0));
}
if (priv->last_visible_node == NULL &&
priv->last_visible_child != NULL)
{
- GtkSnapshot last_visible_snapshot;
+ GtkSnapshot *last_visible_snapshot;
gtk_widget_get_allocation (priv->last_visible_child->widget,
&priv->last_visible_surface_allocation);
- gtk_snapshot_init (&last_visible_snapshot,
- gtk_snapshot_get_renderer (snapshot),
- snapshot->record_names,
- NULL,
- "StackCaptureLastVisibleChild");
- gtk_widget_snapshot (priv->last_visible_child->widget, &last_visible_snapshot);
- priv->last_visible_node = gtk_snapshot_finish (&last_visible_snapshot);
+ last_visible_snapshot = gtk_snapshot_new (gtk_snapshot_get_renderer (snapshot),
+ snapshot->record_names,
+ NULL,
+ "StackCaptureLastVisibleChild");
+ gtk_widget_snapshot (priv->last_visible_child->widget, last_visible_snapshot);
+ priv->last_visible_node = gtk_snapshot_free_to_node (last_visible_snapshot);
}
gtk_snapshot_push_clip (snapshot,
GList *list;
GdkRectangle background_area;
GtkWidget *widget;
- GtkSnapshot snapshot;
+ GtkSnapshot *snapshot;
GskRenderNode *rendernode;
gint depth;
/* start drawing inside the black outline */
bin_window_width + 2,
background_area.height + 2);
- gtk_snapshot_init (&snapshot, NULL, FALSE, NULL, "TreeView DragIcon");
+ snapshot = gtk_snapshot_new (NULL, FALSE, NULL, "TreeView DragIcon");
- gtk_snapshot_render_background (&snapshot, context,
+ gtk_snapshot_render_background (snapshot, context,
0, 0,
bin_window_width + 2,
background_area.height + 2);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_SEPARATOR);
gtk_style_context_get_color (context, &color);
- gtk_snapshot_append_color (&snapshot,
+ gtk_snapshot_append_color (snapshot,
&color,
&GRAPHENE_RECT_INIT(
cell_area.x,
else
{
gtk_tree_view_column_cell_snapshot (column,
- &snapshot,
+ snapshot,
&background_area,
&cell_area,
0, FALSE);
cell_offset += gtk_tree_view_column_get_width (column);
}
- rendernode = gtk_snapshot_finish (&snapshot);
+ rendernode = gtk_snapshot_free_to_node (snapshot);
cr = cairo_create (surface);
if (mode == RENDER_SNAPSHOT)
{
GskRenderer *renderer = gtk_widget_get_renderer (widget);
- GtkSnapshot snapshot;
+ GtkSnapshot *snapshot;
cairo_region_t *clip;
GskRenderNode *node;
widget->priv->clip.y - widget->priv->allocation.y,
widget->priv->clip.width,
widget->priv->clip.height});
- gtk_snapshot_init (&snapshot, renderer, FALSE, clip, "Fallback<%s>", G_OBJECT_TYPE_NAME (widget));
- gtk_widget_snapshot (widget, &snapshot);
- node = gtk_snapshot_finish (&snapshot);
+ snapshot = gtk_snapshot_new (renderer, FALSE, clip, "Fallback<%s>", G_OBJECT_TYPE_NAME (widget));
+ gtk_widget_snapshot (widget, snapshot);
+ node = gtk_snapshot_free_to_node (snapshot);
if (node != NULL)
{
gsk_render_node_draw (node, cr);
const cairo_region_t *region)
{
GdkDrawingContext *context;
- GtkSnapshot snapshot;
+ GtkSnapshot *snapshot;
GskRenderer *renderer;
GskRenderNode *root;
cairo_region_t *clip;
context = gsk_renderer_begin_draw_frame (renderer, region);
clip = gdk_drawing_context_get_clip (context);
- gtk_snapshot_init (&snapshot,
- renderer,
- should_record_names (widget, renderer),
- clip,
- "Render<%s>", G_OBJECT_TYPE_NAME (widget));
+ snapshot = gtk_snapshot_new (renderer,
+ should_record_names (widget, renderer),
+ clip,
+ "Render<%s>", G_OBJECT_TYPE_NAME (widget));
cairo_region_destroy (clip);
- gtk_widget_snapshot (widget, &snapshot);
- root = gtk_snapshot_finish (&snapshot);
+ gtk_widget_snapshot (widget, snapshot);
+ root = gtk_snapshot_free_to_node (snapshot);
if (root != NULL)
{
gtk_inspector_record_render (widget,